package com.hdax.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hdax.entity.Customer;
import com.hdax.dao.CustomerMapper;
import com.hdax.service.CustomerService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * <p>
 * 客户表 服务实现类
 * </p>
 *
 * @author ${author}
 * @since 2021-03-22
 */
@Service
public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> implements CustomerService {

    @Autowired
    private CustomerMapper customerMapper;

    public IPage<Customer> findCustomer(IPage<?> page, @Param("map") Map map){
        return customerMapper.findCustomer(page,map);
    }

    public Customer findCustomerById(Integer id){
        return customerMapper.findCustomerById(id);
    }

    @Override
    public Integer findThisMonthCustomerAddCount() {
        return customerMapper.findThisMonthCustomerAddCount();
    }

    @Override
    public Integer findCustomerCount() {
        return customerMapper.findCustomerCount();
    }

    @Override
    public Float findCustomerChainCompare() {
        return customerMapper.findCustomerChainCompare();
    }

    @Override
    public Map findThisYearCustomerIncre() {
        return customerMapper.findThisYearCustomerIncre();
    }
}
